home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 033a / medit_.zip / MDEMO.CPP < prev    next >
C/C++ Source or Header  |  1993-04-07  |  3KB  |  54 lines

  1. #include <dos.h>
  2. #include <conio.h>
  3. void setmousecursor(int hotspotx, int hotspoty, void far *mbufp);
  4. void mouse(int ax, int bx, int cx, int dx);
  5. extern int Max, Mbx, Mcx, Mdx; // global variables
  6. void main()
  7.   {
  8.  
  9.   // this type definition neccessary for medit mouses
  10.  
  11.   typedef union
  12.     {
  13.     struct {unsigned char Cursor_mask[32],Screen_mask[32];} m;
  14.     unsigned char Mouse_mask[64];
  15.     } MOUSE;
  16.  
  17.   // the following code produced by MEDIT! //
  18.  
  19.   MOUSE pressakey = {0x24, 0x33, 0x6D, 0x55, 0x24, 0x33, 0x76, 0x75, 0x24, 0x75, 0xFF, 0xFF, 0xFF, 0xFE, 0x7F, 0xFD, 0x3F, 0xF8, 0xBF, 0xFB, 0xFF, 0xFF, 0x75, 0x69, 0xAD, 0x5B, 0xDD, 0x39, 0xDF, 0x5B, 0xDD, 0x69,
  20.   0xDB, 0xCC, 0x92, 0xAA, 0xDB, 0xCC, 0x89, 0x8A, 0xDB, 0x8A, 0x0, 0x0, 0x0, 0x1, 0x80, 0x2, 0xC0, 0x7, 0x40, 0x4, 0x0, 0x0, 0x8A, 0x96, 0x52, 0xA4, 0x22, 0xC6, 0x20, 0xA4, 0x22, 0x96};
  21.  
  22.   MOUSE upl = {0xFF, 0x7F, 0xFF, 0xBF, 0xFF, 0xDF, 0xFF, 0xEF, 0xFF, 0xF7, 0xFF, 0xFB, 0xFF, 0xFD, 0xFF, 0xFE, 0x7F, 0xFF, 0xBF, 0xFF, 0xDF, 0xFF, 0xEF, 0xFF, 0xF7, 0xFF, 0xFB, 0xFF, 0xFD, 0xFF, 0xFE, 0xFF,
  23.   0x0, 0x80, 0x0, 0x40, 0x0, 0x20, 0x0, 0x10, 0x0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 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
  32.   0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
  33.  
  34.   // The preceding code produced by MEDIT! //
  35.  
  36.   _AH=0; _AL=0x13; geninterrupt(0x10); // set 320x200 256 color graphics mode
  37.   mouse(0,0,0,0); // initialize the mouse
  38.   mouse(1,0,0,0); // display the mouse
  39.  
  40.   setmousecursor(0,0,&pressakey);
  41.   while(!kbhit()){}
  42.   getch();
  43.   while(!kbhit()){ // animate the mouse cursor by flipping thru them.
  44.   setmousecursor(0,0,&upl);
  45.   delay(75);
  46.   setmousecursor(0,0,&upd);
  47.   delay(75);
  48.   setmousecursor(0,0,&upr);
  49.   delay(75);
  50.   setmousecursor(0,0,&lr);
  51.   delay(75);}
  52.  
  53.   _AH=0; _AL=0x03; geninterrupt(0x10); // go back to text mode
  54.   }